package com.sitech.util;

import java.util.List;

import javax.servlet.http.HttpSession;

import com.sitech.BaseConst;
import com.sitech.portal.system.domain.TblSYS_LOGINMSG;

public class SessionUtil
{
	/**
	 * getLoginUser: 获得登陆用户信息
	 * @param session
	 * @return 
	 * @throws 
	 * @since　Ver 1.1
	*/
	public static  TblSYS_LOGINMSG getLoginUser(HttpSession session)
	{
		TblSYS_LOGINMSG user = (TblSYS_LOGINMSG) session.getAttribute(BaseConst.SESSION_USER_KEY);
		return user;
	}
	
	/**
	 * getLoginUserRole: 获得登陆用户的所有角色
	 * @param session
	 * @return 
	 * @throws 
	 * @since　Ver 1.1
	*/
	public static List getLoginUserRole(HttpSession session)
	{
		List roleList =  (List) session.getAttribute(BaseConst.SESSION_USER_ROL_KEY);
		return roleList;
	}
	
	public static String getLoginUserAuthCode(HttpSession session)
	{
		return (String) session.getAttribute(BaseConst.SESSION_AUTH_CODE_PATH);
	}
}
